/**********************************************************************
* File: main.cpp
* ID  : 1
* Purpose: The main program of Interactive Fiction.
* Date   : 2004/04/19
* Author : T.S.Yo
* Description:
**********************************************************************/
#include <iostream>
#include <fstream>
//#include <string>
#include "ifEngine.cpp"

using namespace std;

int main(int argc, char *argv[])
{
    if (argc != 3)
    {
        cout << "Usage: play [map_file] [item_file]\n";
        cout << "  Use default:\n"
             << "    map_file  = map01.dat\n"
             << "    item_file = items.dat\n";
    // Create ifEngine object
        ifEngine engine;
    
    // Load game
        engine.loadMap("map01.dat");
        engine.loadItem("items.dat");
    
    // Start game
        engine.start();
    
    // End game
        engine.end();
    }
    else
    { 
    // Create ifEngine object
        ifEngine engine;
    
    // Load game
        engine.loadMap(argv[1]);
        engine.loadItem(argv[2]);
    
    // Start game
        engine.start();
    
    // End game
        engine.end();
    }
    return 0;
}

